package com.xsz.entity;

import lombok.Getter;
import lombok.Setter;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;

@Entity
@Table(name="tb_administrator")
@Getter
@Setter
public class Administrator implements Serializable {
    private static final long serialVersionUID = 1L;
    /**主键ID**/
    @Id
    @Column(length=60)
    private String id;

    /**账号**/
    @Column(length=30)
    private String name;

    /**密码**/
    @Column(length=90)
    private String pwd;

    /**加密密码的盐**/
    private String salt;

    /**
     * 密码盐. * @return
     * 这个方法重新对盐重新进行了定义，用户名+salt，这样就更加不容易被破解了。
     */
    public String getCredentialsSalt(){
        return this.name+this.salt;

    }
}
